import request from '@/utils/request'

// 查询报价单列表
export function listOfferOrder(query) {
  return request({
    url: '/wms/offerOrder/list',
    method: 'get',
    params: query
  })
}

// 查询报价单详细
export function getOfferOrder(orderCode) {
  return request({
    url: '/wms/offerOrder/' + orderCode,
    method: 'get'
  })
}
// 查询报价单详细（重新审核）
export function getAuditOfferOrder(orderCode) {
  return request({
    url: '/wms/offerOrder/restartAudit/' + orderCode,
    method: 'get'
  })
}

// 新增报价单
export function addOfferOrder(data) {
  return request({
    url: '/wms/offerOrder',
    method: 'post',
    data: data
  })
}

// 创建合同
export function createContract(data) {
  return request({
    url: '/wms/offerOrder/createContract',
    method: 'post',
    data: data
  })
}

// 上报报价
export function reportOffer(data) {
  return request({
    url: '/wms/offerOrder/reportOffer',
    method: 'post',
    data: data
  })
}

// 修改报价单
export function updateOfferOrder(data) {
  return request({
    url: '/wms/offerOrder',
    method: 'put',
    data: data
  })
}

// 删除报价单
export function delOfferOrder(orderCode) {
  return request({
    url: '/wms/offerOrder/' + orderCode,
    method: 'delete'
  })
}
